package com.aptech.domain.JPA;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * EventRequestId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class EventRequestId implements java.io.Serializable {

	// Fields

	private Integer eventRequestId;
	private Integer eventId;
	private Integer accountId;

	// Constructors

	/** default constructor */
	public EventRequestId() {
	}

	/** full constructor */
	public EventRequestId(Integer eventRequestId, Integer eventId,
			Integer accountId) {
		this.eventRequestId = eventRequestId;
		this.eventId = eventId;
		this.accountId = accountId;
	}

	// Property accessors
        @Id
        @GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "EVENT_REQUEST_ID", unique = true, nullable = false)
	public Integer getEventRequestId() {
		return this.eventRequestId;
	}

	public void setEventRequestId(Integer eventRequestId) {
		this.eventRequestId = eventRequestId;
	}

	@Column(name = "EVENT_ID", nullable = false)
	public Integer getEventId() {
		return this.eventId;
	}

	public void setEventId(Integer eventId) {
		this.eventId = eventId;
	}

	@Column(name = "ACCOUNT_ID", nullable = false)
	public Integer getAccountId() {
		return this.accountId;
	}

	public void setAccountId(Integer accountId) {
		this.accountId = accountId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof EventRequestId))
			return false;
		EventRequestId castOther = (EventRequestId) other;

		return ((this.getEventRequestId() == castOther.getEventRequestId()) || (this
				.getEventRequestId() != null
				&& castOther.getEventRequestId() != null && this
				.getEventRequestId().equals(castOther.getEventRequestId())))
				&& ((this.getEventId() == castOther.getEventId()) || (this
						.getEventId() != null
						&& castOther.getEventId() != null && this.getEventId()
						.equals(castOther.getEventId())))
				&& ((this.getAccountId() == castOther.getAccountId()) || (this
						.getAccountId() != null
						&& castOther.getAccountId() != null && this
						.getAccountId().equals(castOther.getAccountId())));
	}

	public int hashCode() {
		int result = 17;

		result = 37
				* result
				+ (getEventRequestId() == null ? 0 : this.getEventRequestId()
						.hashCode());
		result = 37 * result
				+ (getEventId() == null ? 0 : this.getEventId().hashCode());
		result = 37 * result
				+ (getAccountId() == null ? 0 : this.getAccountId().hashCode());
		return result;
	}

}